﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LEET.CommonInterfaces.Compilers;
using LEET.LEETCommon.Model;
using LEET.CommonInterfaces.TestControls;

namespace LEET.StandardModuals.Instructions
{
    public class Pause : Instruction
    {
        private String pause;

        public Pause(string[] args)
            : base(args)
        {
            pause = args[1].Trim();
        }

        public static IAutomationActionResult StaticCall()
        {
            //TODO
            return null;
        }

        public override String RenderStaticCall()
        {
            //TODO
            return "LEET.StandardModuals.Instructions.Pause.StaticCall()";
        }

        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override String RenderedMethodName(int i)
        {
            return "_" + i + "_PAUSE";
        }

        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override String MethodBody(AssertionSet asserts)
        {
            return "                Thread.Sleep(" + pause + ");\r\n                return new AutomationActionResult();\r\n";
        }


        public override string PlainText()
        {
            return "Wait for " + int.Parse(pause) + " milliseconds.";
        }
    }
}
